"""系统设置页面"""
from selenium.webdriver.common.by import By

from page.base_page import BasePage


class SystemSettingPage(BasePage):
    url="/index.php?m=setting&a=defaultInfo"
    #定位器
    table_locator = (By.CSS_SELECTOR, "body > div.container > div.tabbable > div > form > table > tbody")
    leads_out_days_locator = (By.CSS_SELECTOR, "#leads_outdays")
    save_locator = (By.NAME, "submit")
    success_text_locator = (By.CLASS_NAME, "alert-success")
    #方法
    def input_days(self,day):
        #输入自动回到线索池天数
        trs=self.driver.find_elements(*self.table_locator)
        input_day=trs[0].find_element(*self.leads_out_days_locator)
        input_day.clear()
        input_day.send_keys(day)
    def save_setting(self):
        #点击保存
        self.find_element(self.save_locator).click()
    def save_success_text(self):
        #保存成功的信息
        return self.find_element(self.success_text_locator).text
